home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / Textra120 / Textra Installer < prev    next >
Encoding:
Text File  |  1996-10-31  |  7.8 KB  |  317 lines

  1. ; Script to install Textra 1.16 11-Nov-94  (for CBM Installer 1.24)
  2. ;
  3. ; 960201 added ReadMe.Margins and shadow files
  4.  
  5. ; get the OS version number (34=1.3, 36=2.0, 37=2.1, etc)
  6. (set vernum (getversion))
  7. (set vernum (/ vernum 65536))
  8.  
  9. (set filesOk 0)
  10.  
  11. (if (exists "scripts" (noreq))
  12.  (if (exists "scripts/JForth_Scripts" (noreq))
  13.   (if (exists "scripts/C_Scripts" (noreq))
  14.    (if (exists "scripts/HSPascal_Scripts" (noreq))
  15.     (if (exists "scripts/SASC_Scripts" (noreq))
  16.      (if (exists "docs" (noreq))
  17.       (if (exists "Textra" (noreq))
  18.        (if (exists "Textra.info" (noreq))
  19.         (if (exists "Fonts" (noreq))
  20.             (set filesOk 1)
  21. )))))))))
  22.  
  23. (if (= filesOk 0)
  24.     (exit "\n\nSorry, the Textra Installer cannot function as some of the required files or directories are missing.")
  25. )
  26.  
  27. (set AppDirName
  28.     (askdir
  29.         (prompt "Please choose the drawer in which the Textra executable (and its icon) should be installed...")
  30.         (help (cat "You may run Textra from anywhere.  It does not need any specific assigns.\n\n" @askdir-help))
  31.         (default "Work:")
  32. ;        (newpath)
  33.     )
  34. )
  35. (set @default-dest AppDirName)
  36.  
  37.  
  38. (if (= (getversion "libs:rexxsyslib.library") 0)
  39.     (
  40.         (if (askbool
  41.                 (prompt "\nARexx does not seem to be installed on your system.\n\nDo you want to install the Textra-ARexx scripts anyway?")
  42.                 (help "After you install ARexx, Textra will expect these files to reside in whatever drawer you assign as \"REXX:\"...")
  43.             )
  44.         )
  45.         (set usesARexx 1)
  46.         (set usesARexx 0)
  47.     )
  48.         (set usesARexx 1)
  49. )    
  50.  
  51. (if (= usesARexx 1)
  52.     (if (exists "rexx:" (noreq))
  53.         (set RexxDirName "rexx:")
  54.         (set RexxDirName
  55.             (askdir
  56.                 (prompt "Please choose the drawer in which the Textra-Arexx scripts should be installed \(normally REXX: but you do not have it assigned\)...")
  57.                 (help @askdir-help)
  58.                 (default "Work:TextraScripts")
  59.                 (newpath)
  60.             )
  61.         )
  62.     )
  63. )
  64.  
  65. (if (askbool
  66.         (prompt "\nDo you want to copy the Textra documentation to your hard disk?\n\nIt is several files totaling around 140k and is very detailed and complete.")
  67.         (help "\nThe documentation covers Textra as an editor, how to use the provided Arexx scripts (also writing your own), complete version history, much more.  Many files have MARKs defined for them.\n\nHighly recommended for beginners.")
  68.     )
  69.     (
  70.         (set DocsDirName
  71.             (askdir
  72.                 (prompt "Please choose the drawer in which the Textra documentation should be installed...")
  73.                 (help @askdir-help)
  74.                 (default "Work:TextraDocs")
  75.                 (newpath)
  76.             )
  77.         )
  78.         (set usesDocs 1)
  79.     )
  80.     (
  81.         (set usesDocs 0)
  82.     )
  83. )
  84.  
  85. (set LangOptions (askoptions
  86.         (prompt "Programmers...\n\nThe Textra package includes a few ARexx scripts that are language-specific.  That is, there are different sets for different languages.\n\nCheck any languages that you program in...")
  87.         (help @askoptions-help)
  88.         (choices "JForth Professional 3.x" "HS/Pascal" "C language")
  89.         (default 0)
  90.     )
  91. )
  92.  
  93. (if (BITAND LangOptions 1)
  94.     (set usesJForth 1)
  95.     (set usesJForth 0)
  96. )
  97. (if (BITAND LangOptions 2)
  98.     (set usesHSPascal 1)
  99.     (set usesHSPascal 0)
  100. )
  101. (if (BITAND LangOptions 4)
  102.     (
  103.         (set usesC 1)
  104.         (if (askbool
  105.                 (prompt "\n\nDo you use SAS/C?")
  106.                 (help "\nIn addition to general-use C scripts, the package includes some specific interface scripts to fully integrate Textra with the SAS/C compiler!")
  107.             )
  108.             (set usesSASC 1)
  109.             (set usesSASC 0)
  110.         )
  111.     )
  112.     (
  113.         (set usesC 0)
  114.         (set usesSASC 0)
  115.     )
  116. )
  117.  
  118. (set activateSASC 0)
  119. (if (= usesSASC 1)
  120.     (if (askbool
  121.             (prompt "\nYou can use Textra as a replacement for 'SE' (the SAS-provided editor).\n\nThe Textra package contains a configuration file (SCMSG) which informs SAS/C to automatically use Textra.\n\n Do you want to install it now?")
  122.             (help "\nAnwering 'Yes' activates Textra as the default SAS/C editor.  The next time you launch SAS/C, it will use Textra.\n\nAnswering 'No' causes no SAS/C configuration changes to occur.")
  123.         )
  124.         (set activateSASC 1)
  125.     )
  126. )
  127.  
  128. (set promptStr ("Operations to perform:\n----------------------\n\nCopy Textra and icon to %s\n\nCopy Textra.font to fonts:" AppDirName))
  129. (if (= usesDocs 1)
  130.     (set promptStr ("%s\n\nCopy the Textra Docs to %s" promptStr DocsDirName))
  131. )
  132.  
  133. (if (= usesARexx 1)
  134.     (set usesARexxStr ("\n\nCopy the Textra-ARexx scripts to %s" RexxDirName))
  135.     (set usesARexxStr "")
  136. )
  137. (if (OR (OR (= usesC 1) (= usesJForth 1)) (= usesHSPascal 1))
  138.     (
  139.         (set inclStr "\nincluding support for: ")
  140.         (if (= usesC 1)
  141.             (if (= usesSASC 1)
  142.                 (set inclStr (cat inclStr "SAS/C"))
  143.                 (set inclStr (cat inclStr "C"))
  144.             )
  145.         )
  146.         (if (= usesJForth 1)
  147.             (
  148.                 (if (= usesC 1)
  149.                     (set inclStr (cat inclStr ", "))
  150.                 )
  151.                 (set inclStr (cat inclStr "JForth"))
  152.             )
  153.         )
  154.         (if (= usesHSPascal 1)
  155.             (
  156.                 (if (OR (= usesC 1) (= usesJForth 1))
  157.                     (set inclStr (cat inclStr ", "))
  158.                 )
  159.                 (set inclStr (cat inclStr "HS/Pascal"))
  160.             )
  161.         )
  162.     )
  163.     (set inclStr "")
  164. )
  165.  
  166. (if (= usesSASC 1)
  167.     (set usesSASCStr "\n\nInstall Textra as default SAS/C editor")
  168.     (set usesSASCStr "")
  169. )
  170. (message (cat promptStr usesARexxStr inclStr usesSASCStr))
  171.  
  172. (copyfiles
  173.     (prompt "Copying Textra")
  174.     (help @copyfiles-help)
  175.     (source "Textra")
  176.     (dest AppDirName)
  177.     (infos)
  178. )
  179.  
  180. (copyfiles
  181.     (prompt "Copying Textra.font")
  182.     (help @copyfiles-help)
  183.     (source "Fonts")
  184.     (pattern "#?")
  185.     (dest "fonts:")
  186. )
  187. (if (exists "sys:system/fixfonts" (noreq))
  188.     (run "sys:system/fixfonts")
  189. )
  190.  
  191. (if (= usesARexx 1)
  192.     (
  193.         (copyfiles
  194.             (prompt "Copying General Textra-ARexx Scripts")
  195.             (help @copyfiles-help)
  196.             (source "scripts")
  197.             (pattern "#?.textra")
  198.             (files)
  199.             (dest RexxDirName)
  200.         )
  201.         (if (= usesC 1)
  202.             (copyfiles
  203.                 (prompt "Copying General \"C\" Textra-ARexx Scripts")
  204.                 (help @copyfiles-help)
  205.                 (source "scripts/C_scripts")
  206.                 (pattern "#?.textra")
  207.                 (files)
  208.                 (dest RexxDirName)
  209.             )
  210.         )
  211.         (if (= usesSASC 1)
  212.             (copyfiles
  213.                 (prompt "Copying Textra-ARexx Scripts for SAS/C")
  214.                 (help @copyfiles-help)
  215.                 (source "scripts/SASC_scripts")
  216.                 (pattern "#?.textra")
  217.                 (files)
  218.                 (dest RexxDirName)
  219.             )
  220.             (if (= activateSASC 1)
  221.                 (
  222.                     (if (= vernum 34)
  223.                         (
  224.                             (if (exists "sc:env/SCMSG" (noreq))
  225.                                 (rename "sc:env/SCMSG" "sc:env/SCMSG.preTextra")
  226.                             )
  227.                             (textfile
  228.                                 (include "scripts/SASC_scripts/4.installer.use")
  229.                                 (append ("EDITCOMMAND \"%s\" %%f" (tackon AppDirName "Textra")))
  230.                                 (dest "sc:env/SCMSG")
  231.                             )
  232.                             (copyfiles
  233.                                 (source "sc:env/SCMSG")
  234.                                 (dest "env:sc/SCMSG")
  235.                             )
  236.                         )
  237.                         (
  238.                             (if (exists "envarc:sc/SCMSG" (noreq))
  239.                                 (rename "envarc:sc/SCMSG" "envarc:sc/SCMSG.preTextra")
  240.                             )
  241.                             (textfile
  242.                                 (include "scripts/SASC_scripts/4.installer.use")                      
  243.                                 (append ("EDITCOMMAND \"%s\" %%f" (tackon AppDirName "Textra")))      
  244.                                 (dest "envarc:sc/SCMSG")
  245.                             )
  246.                             (copyfiles
  247.                                 (source "envarc:sc/SCMSG")
  248.                                 (dest "env:sc/SCMSG")
  249.                             )
  250.                         )
  251.                     )
  252.                 )
  253.             )
  254.         )
  255.         (if (= usesJForth 1)
  256.             (copyfiles
  257.                 (prompt "Copying Textra-ARexx Scripts for JForth")
  258.                 (help @copyfiles-help)
  259.                 (source "scripts/JForth_scripts")
  260.                 (pattern "#?.textra")
  261.                 (files)
  262.                 (dest RexxDirName)
  263.             )
  264.         )
  265.         (if (= usesHSPascal 1)
  266.             (copyfiles
  267.                 (prompt "Copying Textra-ARexx Scripts for HS/Pascal")
  268.                 (help @copyfiles-help)
  269.                 (source "scripts/HSPascal_scripts")
  270.                 (pattern "#?.textra")
  271.                 (files)
  272.                 (dest RexxDirName)
  273.             )
  274.         )
  275.     )
  276. )
  277.  
  278. (if (= usesDocs 1)
  279.     (
  280.         (copyfiles
  281.             (prompt "Copying Docs")
  282.             (help @copyfiles-help)
  283.             (source "Docs")
  284.             (pattern "#?")
  285.             (dest DocsDirName)
  286.             (infos)
  287.         )
  288.         (copyfiles
  289.             (prompt "Copying Docs")
  290.             (help @copyfiles-help)
  291.             (source "ReadMe")
  292.             (dest DocsDirName)
  293.             (infos)
  294.         )
  295.         (copyfiles
  296.             (prompt "Copying Docs")
  297.             (help @copyfiles-help)
  298.             (source "}ReadMe")
  299.             (dest DocsDirName)
  300.             (infos)
  301.         )
  302.     )
  303. )
  304.  
  305. (set exitStr "")
  306.  
  307. (if (= usesDocs 1)
  308.     (set exitStr (cat exitStr ("Documentation in your \"%s\" drawer.\n\n" DocsDirName)))
  309. )
  310.  
  311. (if (= usesARexx 1)
  312.     (set exitStr (cat exitStr ("ARexx scripts in your \"%s\" drawer.\n\n" RexxDirName)))
  313. )
  314.  
  315. (exit exitStr)
  316.  
  317.